<?php
/**
 * Created by XiaoYu.
 * User: XiaoYu
 * Date: 2021/8/2
 * Time: 11:12
 * Desc: ${Desc}
 */

namespace App\Http\Forms;


use App\Modules\Shop\Shop;
use Kris\LaravelFormBuilder\Form;

class RechargeRecordForm extends Form
{
    public function buildForm()
    {
        $allShop = Shop::query()->pluck('name', 'id')->all();
        $this
            ->add('shop_id', 'select', [
                'label' => '选择商户',
                'rules' => 'required|string',
                'choices' => $allShop,
            ])
            ->add('cz_money', 'number', [
                'attr' => ['class' => "form-control form-money"],
                'label' => "充值金额",
                'rules' => 'required|numeric',
            ])
            ->add('zs_money', 'number', [
                'attr' => ['class' => "form-control form-money"],
                'label' => "赠送金额",
                'rules' => 'required|numeric',
            ])
            ->add('user_id', 'hidden', [
            ])
            ->add('submit', 'submit', [
                'attr' => ['class' => "form-control btn btn-success"],
                'label' => '保存',
            ]);
    }
}
